package com.hedl.classroom.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * ProjectName: onlinec-classroom
 * DateTime: 2023/7/20 00:23
 * Author: Big Watermelon
 * Description: Freemarker入门程序
 */
@Slf4j
@Controller
public class FreemarkerController {

    @GetMapping("/testfreemarker")
    public ModelAndView test(){
        ModelAndView modelAndView = new ModelAndView();
        //设置模型数据
        modelAndView.addObject("name","小明");

        //设置模板名称
        modelAndView.setViewName("test");

        return modelAndView;
    }
}
